package com.example.demo.entity;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.example.demo.handler.JSONObjectTypeHandler;
import com.mysql.cj.xdevapi.JsonString;
import lombok.Data;

/**
 * @Author: lu
 * @Date: 2024-08-14-9:02
 * @Description:
 */
@Data
@TableName("product")
public class Product {
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private Integer id;

    @TableField("product_name")
    private String productName;

    @TableField(value = "attributes",typeHandler = JSONObjectTypeHandler.class)
    private JSONObject attributes;

    @TableField(value = "value")
    private String value;

    @TableField(value = "data",typeHandler = JacksonTypeHandler.class)
    private JsonString data;
}
